namespace LS.Digitize
{
    public struct ReadCollectionScope: IScope
    {
        public IReader Reader { get; private set; }
        public bool ReadFailure { get; private set; }
        public ReadCollectionScope(IReader reader)
        {
            Reader = reader;
            ReadFailure = !reader.StartReadCollection();
        }
        
        public void Dispose()
        {
            Reader.EndReadCollection();
            Reader = null;
        }
    }
}